﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SAPSSOEXT;
using System.IO;


namespace Crosland.Automotriz.Logic
{
    public class LecturaTicketSAP
    {

        public string LeerCookiesSAP(string Ticket,string rutaSapSecu,string rutaVerify)
        {
            try
            {

                SAPSSOEXT.SSO2Ticket objSSO = new SAPSSOEXT.SSO2Ticket();

                objSSO.CryptLib = rutaSapSecu;
                string strKeypath = rutaVerify;

                object tt;
                tt = objSSO.EvalLogonTicket(Ticket, strKeypath, null);

                object[] ts = tt as object[];

                string userId = ts[0].ToString();

                return userId;
            }
            catch (Exception ex)
            {
                
                throw ex;
            }


        }

    }
}
